package com.space.school.service.impl;

import com.space.school.dao.LoginDao;
import com.space.school.dao.impl.LoginDaoImpl;
import com.space.school.domain.User;
import com.space.school.service.LoginService;

public class LoginServiceImpl implements LoginService {
    private LoginDao loginDao=new LoginDaoImpl();
    @Override
    public boolean login(String username, String password) {
//        登录校验
//        通过dao 访问数据库后 将值进行返回,看是否有值
//        有值则登陆成功
        User user=loginDao.login(username,password);
        if(user!=null){
            return true;
        }
        return false;
    }
    @Override
    public boolean login_username(String username){
        User user=loginDao.login_username(username);
        if(user!=null){
            return true;
        }
        return false;
    }
}
